package logmgr;

import static Common.ByteArray.*;

public class RollbackRecord extends LogMgr {

	public void redo (){ }
	
	public void undo () { }

	@Override
	public void read() throws Exception {
		byte buff [] = new byte [ 4 ] ; 
		file.read( buff ) ;
		txnum = readInt ( buff, 0 ) ;
	}

	@Override
	public void write(int txnum, int pageid, int pos, Object old, Object cur)
			throws Exception {
		byte buff [] = new byte [ 8 ] ;
		writeInt ( buff, 0, ROLLBACK ) ;
		writeInt ( buff, 4, txnum ) ;
		file.seek( file.length() ) ; 
		file.write( buff ) ;
	}
}
